using SalesPages.DomainModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class SEOContentMap : EntityTypeConfiguration<SEOContent>
    {
        public SEOContentMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.locale)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.urlcategory)
                .IsRequired()
                .HasMaxLength(14);

            this.Property(t => t.urlreal)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.categoryname)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.metatitle)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.metades)
                .IsRequired()
                .HasMaxLength(600);

            this.Property(t => t.metakeywords)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.menutext)
                .IsRequired()
                .HasMaxLength(200);

            this.Property(t => t.headline1)
                .IsRequired()
                .HasMaxLength(100);

            this.Property(t => t.content1)
                .IsRequired()
                .HasMaxLength(8000);

            this.Property(t => t.link1)
                .HasMaxLength(50);

            this.Property(t => t.headline2)
                .HasMaxLength(100);

            this.Property(t => t.content2)
                .HasMaxLength(8000);

            this.Property(t => t.link2)
                .HasMaxLength(50);

            this.Property(t => t.headline3)
                .HasMaxLength(100);

            this.Property(t => t.content3)
                .HasMaxLength(8000);

            this.Property(t => t.link3)
                .HasMaxLength(50);

            this.Property(t => t.headline4)
                .HasMaxLength(100);

            this.Property(t => t.content4)
                .HasMaxLength(8000);

            this.Property(t => t.link4)
                .HasMaxLength(50);

            this.Property(t => t.otherlink1)
                .HasMaxLength(200);

            this.Property(t => t.othertext1)
                .HasMaxLength(50);

            this.Property(t => t.otherlink2)
                .HasMaxLength(200);

            this.Property(t => t.othertext2)
                .HasMaxLength(50);

            this.Property(t => t.otherlink3)
                .HasMaxLength(200);

            this.Property(t => t.othertext3)
                .HasMaxLength(50);

            this.Property(t => t.otherlink4)
                .HasMaxLength(200);

            this.Property(t => t.othertext4)
                .HasMaxLength(50);

            this.Property(t => t.otherlink5)
                .HasMaxLength(200);

            this.Property(t => t.othertext5)
                .HasMaxLength(50);

            this.Property(t => t.ImgUrl1)
                .HasMaxLength(100);

            this.Property(t => t.ImgUrl2)
                .HasMaxLength(100);

            this.Property(t => t.ImgUrl3)
                .HasMaxLength(100);

            this.Property(t => t.ImgUrl4)
                .HasMaxLength(100);

            this.Property(t => t.FooterText)
                .HasMaxLength(100);

            this.Property(t => t.FooterLink)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("SEOContent");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.locale).HasColumnName("locale");
            this.Property(t => t.urlcategory).HasColumnName("urlcategory");
            this.Property(t => t.urlreal).HasColumnName("urlreal");
            this.Property(t => t.categoryname).HasColumnName("categoryname");
            this.Property(t => t.metatitle).HasColumnName("metatitle");
            this.Property(t => t.metades).HasColumnName("metades");
            this.Property(t => t.metakeywords).HasColumnName("metakeywords");
            this.Property(t => t.menutext).HasColumnName("menutext");
            this.Property(t => t.headline1).HasColumnName("headline1");
            this.Property(t => t.content1).HasColumnName("content1");
            this.Property(t => t.link1).HasColumnName("link1");
            this.Property(t => t.headline2).HasColumnName("headline2");
            this.Property(t => t.content2).HasColumnName("content2");
            this.Property(t => t.link2).HasColumnName("link2");
            this.Property(t => t.headline3).HasColumnName("headline3");
            this.Property(t => t.content3).HasColumnName("content3");
            this.Property(t => t.link3).HasColumnName("link3");
            this.Property(t => t.headline4).HasColumnName("headline4");
            this.Property(t => t.content4).HasColumnName("content4");
            this.Property(t => t.link4).HasColumnName("link4");
            this.Property(t => t.otherlink1).HasColumnName("otherlink1");
            this.Property(t => t.othertext1).HasColumnName("othertext1");
            this.Property(t => t.otherlink2).HasColumnName("otherlink2");
            this.Property(t => t.othertext2).HasColumnName("othertext2");
            this.Property(t => t.otherlink3).HasColumnName("otherlink3");
            this.Property(t => t.othertext3).HasColumnName("othertext3");
            this.Property(t => t.otherlink4).HasColumnName("otherlink4");
            this.Property(t => t.othertext4).HasColumnName("othertext4");
            this.Property(t => t.otherlink5).HasColumnName("otherlink5");
            this.Property(t => t.othertext5).HasColumnName("othertext5");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
            this.Property(t => t.SeoType).HasColumnName("SeoType");
            this.Property(t => t.ImgUrl1).HasColumnName("ImgUrl1");
            this.Property(t => t.ImgUrl2).HasColumnName("ImgUrl2");
            this.Property(t => t.ImgUrl3).HasColumnName("ImgUrl3");
            this.Property(t => t.ImgUrl4).HasColumnName("ImgUrl4");
            this.Property(t => t.FooterText).HasColumnName("FooterText");
            this.Property(t => t.FooterLink).HasColumnName("FooterLink");
        }
    }
}
